{% extends 'tasks/base.html' %}
{% block title %}爬虫练习{% endblock %}

{% block content %}
    {% load static %}

    <div class="container-fluid">
        <div class="row lab-row">
            <br />
            <div class="col-lg-3 col-md-3 col-sm-2"></div>
            <div class="col-lg-6 col-md-6 col-sm-8 col-xs-12">
                <div class="lab-block">
                    <div class="panel panel-default">
                        <div class="panel-heading" style="font-size: 22px; display: flex; justify-content: space-between;">
                            <span>爬虫练习 —— 层层关卡，等你来闯！</span>
                        </div>
                    </div>

                    <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
                        {% for task in tasklist %}
                        <div class="panel panel-default">
                            <div class="panel-heading" role="tab" id="heading{{task.id}}">
                                <h4 class="panel-title">
                                    <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse{{task.id}}" aria-expanded="false" aria-controls="collapse{{task.id}}">
                                    {{task.title}}
                                    </a>
                                </h4>
                            </div>
                            <div id="collapse{{task.id}}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading{{task.id}}">
                                <div class="panel-body">
                                    <div>{{task.content | safe}}</div>
                                    <br />
                                    <a href="{{task.url}}" class="btn btn-primary active" role="button">点击进入</a>
                                </div>
                            </div>
                        </div>
                        {% endfor %}
                    </div>

                </div>
            </div>
            <div class="col-lg-3 col-md-3 col-sm-2"></div>
        </div>
    </div>

{% endblock %}